package com.lu.manage.core.schedue.quartz.utils;


import com.lu.manage.core.schedue.quartz.schedule.ScheduleJob;
import com.lu.manage.modular.system.model.Task;
import org.quartz.Job;

public class ScheduleJobUtils {

	public static ScheduleJob entityToData(Task scheduleJobEntity) {
		ScheduleJob scheduleJob = new ScheduleJob();
		scheduleJob.setClassBean(scheduleJobEntity.getClassBean());
		scheduleJob.setCronExpression(scheduleJobEntity.getCronExpression());
		scheduleJob.setDescrip(scheduleJobEntity.getDescript());
		scheduleJob.setJobName(scheduleJobEntity.getJobName());
		scheduleJob.setJobGroup(scheduleJobEntity.getJobGroup());
		scheduleJob.setJobState(scheduleJobEntity.getState() + "");
		return scheduleJob;
	}

	public static void main(String[] args) {
		try {
			Class<? extends Job> jobClass = (Class<? extends Job>) Class.forName("com.lu.modular.business.task.QuartzTestTask").newInstance().getClass();
			System.out.println(1);
		} catch (InstantiationException e) {
			e.printStackTrace();
		} catch (IllegalAccessException e) {
			e.printStackTrace();
		} catch (ClassNotFoundException e) {
			e.printStackTrace();
		}
	}

}